#pragma once
#include <map>
#include <string>
#include <gdiplus.h>
using namespace std;
namespace UILib
{
    enum Window_Version 
    {
        Windows_unKnown     = -1,
        Windows_2000        = 0,
        windows_XP          = 1,
        Windows_Sever_2003  = 2,
        Windows_Vista       = 3,
        Windows_7           = 4,
        Windows_8           = 5,
        Windows_81          = 6,
    };

    class CResourceHelper
    {
    public:
        virtual ~CResourceHelper(void);

        static CResourceHelper* GetInstance(void);
        void Init(const wstring wszResDLL);
        void unInit();

        Bitmap* GetBitmapFromID(const UINT ID);
        HICON   GetHICONFromID(const UINT ID);
        HMENU   GetMenuFromID(const UINT ID);
        wstring GetStrngFromID(const UINT ID);
        void    GetLOGFONT(LOGFONT& lf, const float fHeight = 10.5, const bool bBold = false,  const wchar_t* szFaceName = L"Tahoma" );

        static Bitmap* LoadFromBuffer(const BYTE* pBuffer, const DWORD dwLen);
        static Bitmap* LoadFromFile(const wstring wszFileName );
    private:
        CResourceHelper(void);

        Bitmap* LoadFromResource(const UINT ID, const LPCWSTR lpType );

        void GetWindowVersion( Window_Version& eVersion );
    private:
        HINSTANCE           m_hResInstance;
        map<UINT, Bitmap*>  m_pngMap;
        map<UINT, HICON>    m_HiconMap;
        map<UINT, HMENU>    m_MenuMap;

        LOGFONT*            m_plf;
    };
}
